/**
 * author: zhou
 * date: 2017.10.20
 * description: 科目模型
 * {
 *      name: 科目名称
 *      schoolId: 所属学校id
 * }
 */

const mongoose = require('mongoose');

const subjectSchema = new mongoose.Schema({
    name: { type: String, required: true },
    schoolId: { type: mongoose.Schema.Types.ObjectId, ref: 'School', required: true },
    createDate: { type: Date, default: Date.now }
});

module.exports = mongoose.model('Subject', subjectSchema, 'schools.settings.subjects');